#pragma once

#include "net.h"

namespace ann
{

enum eRBF_LAYER
{
    eRBF_In   = 0,
    eRBF_Hide = 1,
    eRBF_Out  = 2,
    eRBF_Err
};

class net_rbf: public net
{
public:
    net_rbf(void);
    net_rbf(const UINT pInCnt, const UINT pHiCnt, const UINT pOutCnt);
    virtual ~net_rbf(void);

public:
    const double SimS(const double p1, const double p2)
    {
        dVec inVec;
        dVec outVec;
        inVec.push_back(p1);
        inVec.push_back(p2);

        Sim(inVec, &outVec);

        return *outVec.begin();
    }


public:
    const UINT Init(const wchar_t* pInitFile = L"rbf_xor_init.info");
    const UINT Reset();
    const UINT Train();
    const UINT InitFromFile(const wchar_t* pInitFile);
    const UINT Sim(const dVec& pInVec, dVec* pOutVec = NULL);

private:
    const UINT   TestConverge();
public:
    const UINT   TRStaticCenter();
    const UINT   TRMSS();
    const UINT   TRGD(const dVec& pObjVec, const dVec& pInVec);

public:
    const UINT Train_Gd();
    const UINT Elect_C_KNN();
    //specify xor 
    const UINT InitStatic(const wchar_t* pInitStaticFile);
    const UINT Elect_Sigma();

public:
    ACCESSOR(m_hiCnt, UINT)

private:
    UINT m_hiCnt;

    //Gd coef
    double m_w_yita;
    double m_c_yita;
    double m_s_yita;
};

}
